﻿using Orchard.Environment.Extensions;
using Orchard.Localization;
using Orchard.UI.Navigation;

namespace ATTools
{
    [OrchardFeature("ATTools.VoiceCommands")]
    public class AdminMenu : INavigationProvider
    {

        public Localizer T { get; set; }

        #region INavigationProvider Members

        public void GetNavigation(NavigationBuilder builder)
        {
            builder.AddImageSet("voicecommands").Add(T("Voice Commands"), "2.5", BuildVoiceCommandMenu);
        }

        public string MenuName
        {
            get { return "admin"; }
        }

        #endregion

        private void BuildVoiceCommandMenu(NavigationItemBuilder menu)
        {
            menu.Add(T("Manage commands"), "1", item => item.Action("VoiceList", "VoiceAdmin", new { area = "ATTools" }).Permission(Permissions.ManageVoiceCommands).LocalNav());
            menu.Add(T("Add a new voice command"), "1", item => item.Action("NewVoiceCommand", "VoiceAdmin", new { area = "ATTools" }).Permission(Permissions.ManageVoiceCommands).LocalNav());
        }
    }
}